home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 April / 1994-04b.d64 / putt putt (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  13KB  |  446 lines

  1. 10 rem ****************************
  2. 20 rem ***                      ***
  3. 30 rem **   miniature golf v.2   **
  4. 40 rem ***                      ***
  5. 50 rem ****************************
  6. 60 rem  idea conceived and written
  7. 70 rem  by wvmike. v.2 as modified
  8. 80 rem  and enhanced by b29gunner.
  9. 90 rem  more enhancements planned.
  10. 100 :
  11. 110 s=54272:p1u=s+1:w1u=s+3:f1w=s+4:a1d=s+5:s1r=s+6:p2l=s+7
  12. 120 u2p=s+8:l2w=s+9:p2u=s+10:f2w=s+11:a2d=s+12:s2r=s+13
  13. 130 :
  14. 140 vol=s+24
  15. 150 rem ^^^ standard sid asddresses ^^^
  16. 160 :
  17. 170 gosub230:rem instructions
  18. 180 gosub850:rem setup
  19. 190 gosub2770:rem play!
  20. 200 goto3790:rem !end!
  21. 210 end
  22. 220 :
  23. 230 :
  24. 240 :rem *** insts ***
  25. 250 :
  26. 260 poke53281,15:poke53280,15
  27. 270 input"[147][144]do you need instructions (y/n):";yn$
  28. 280 ifyn$="n"thenprint"please wait...":return
  29. 290 ifyn$<>"y"then270
  30. 300 print"[147][144]"tab(8)"***  miniature golf ***"
  31. 310 print:print
  32. 320 print"welcome to the alberts country club.    this beautiful nine-hole ";
  33. 330 print"miniature golf course is open and waiting for you !"
  34. 340 print
  35. 350 print"you should know the rules of the course before you begin play !"
  36. 360 print
  37. 370 print"to putt the ball,you have to input      which way you want to ";
  38. 380 print"aim it."
  39. 390 print"there are 8 directions with the ball    assumed at * (see below):
  40. 400 [153]:[153][163]17)"2 1 8":[153][163]17)"3 * 7":[153][163]17)"4 5 6"
  41. 410 [153]:[153]:[153]"press return when ready to continue"
  42. 420 [161]x$:[139]x$[179][177][199](13)[167]420
  43. 430 [153]"load"
  44. 440 [153][163]9)"*** miniature golf ***
  45. 450 print:print
  46. 460 print"then you must input how hard to hit the ball.  the speed should ";
  47. 470 print"be some number  between 0.00 and 5.00.  for example, youcould";
  48. 480 print" hit the ball a relative speed of  3.2"
  49. 490 print
  50. 500 print"it will take a few tries before you get used to how hard to putt ";
  51. 510 print"the ball.":print
  52. 520 print"also, there are four types of hazards onthe course.  you should ";
  53. 530 print"be aware of whatthey are and what affect they have on   you ";
  54. 540 print"and your ball."
  55. 550 print:print:print:print"press return when ready to continue"
  56. 560 getx$:ifx$<>chr$(13)then560
  57. 570 print"[147]"
  58. 580 printtab(9)"*** miniature golf ***
  59. 590 [153]:[153]
  60. 600 [153]"blocks: these are like walls. you must  putt around them."
  61. 610 [153]
  62. 620 [153]"yellow traps represent sand.  your ball cannot penetrate through ";
  63. 630 [153]"a sand trap.   the penalty for landing in the sand is  one stroke."
  64. 640 [153]
  65. 650 [153]"water: like sand, these blue hazards    will stop your ball.";
  66. 660 [153]"  the   penalty for landing in water is one stroke."
  67. 670 [153]
  68. 680 [153]"uneven surfaces: these red hazards causethe ball to roll in ";
  69. 690 [153]"a direction which isunpredictable   there is no  penalty ";
  70. 700 [153]"forhitting this hazard."
  71. 710 [153]:[153]:[153]"press return when ready to continue"
  72. 720 [161]x$:[139]x$[179][177][199](13)[167]720
  73. 730 [153]"loadprint#"
  74. 740 [153][163]9)"*** miniature golf ***
  75. 750 print:print
  76. 760 print"[144]you are trying to sink the ball in as   few tries as possible.  ";
  77. 770 print"the hole is the black square."
  78. 780 print
  79. 790 print"[144]if you hit the ball too hard, it will   jump over the hole and ";
  80. 800 print"continue rolling.it may also change direction, so be sureto hit ";
  81. 810 print"the ball just hard enough."
  82. 820 print:print:print"press return when ready to continue"
  83. 830 getx$:ifx$<>chr$(13)then830
  84. 840 return
  85. 850 :
  86. 860 :rem *** setup ***
  87. 870 :
  88. 880 rem  store fanfare notes
  89. 890 dim yy(12),zz(12)
  90. 900 fori=1to12:readyy(i),zz(i):nexti
  91. 910 data 25,30,18,209,33,135,25,30,42,62,31,165,50,60,37,162,42,62,31,165
  92. 920 data 50,60,37,162
  93. 930 dimha(9,5):fori=1to9:forj=1to5:readha(i,j):next:next
  94. 940 data 0,0,0,0,2
  95. 950 data 1,0,0,0,3
  96. 960 data 0,1,0,0,3
  97. 970 data 1,1,0,0,3
  98. 980 data 0,0,0,1,3
  99. 990 data 0,0,1,1,3
  100. 1000 data 1,0,1,0,3
  101. 1010 data 0,1,1,0,4
  102. 1020 data 0,0,1,1,3
  103. 1030 dimdi(8,2):fori=1to8:readdi(i,1),di(i,2):next
  104. 1040 data 0,-1,-1,-1,-1,0,-1,1,0,1,1,1,1,0,1,-1
  105. 1050 plt=49152:fori=0to24:readc:pokeplt+i,c:nexti
  106. 1060 data 32,16,192,132
  107. 1070 data 253,32,16,192
  108. 1080 data 152,170,164,253
  109. 1090 data 24,76,240,255
  110. 1100 data 32,253,174,32
  111. 1110 data 158,173,76,170,177
  112. 1120 dimv(8):fori=1to8:readv(i):next:data-40,-41,-1,39,40,41,1,-39
  113. 1130 def fnsc(x)=peek(1024+bx+40*by+x)
  114. 1140 def fnco(x)=peek(55296+bx+40*by+x)and15
  115. 1150 return
  116. 1160 rem *** hole 1 ***
  117. 1170 print"":ts=0
  118. 1180 printtab(10)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  119. 1190 fori=1to15
  120. 1200 printtab(10)"[161]                 [146][144][161]"
  121. 1210 next
  122. 1220 printtab(10)"[144][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  123. 1230 print""tab(19)" "
  124. 1240 by=16:bx=11+int(17*rnd(0)):sysplt,bx,by:print"[209]";
  125. 1250 return
  126. 1260 rem *** hole 2 ***
  127. 1270 print"":ts=0
  128. 1280 printtab(8)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  129. 1290 fori=1to5
  130. 1300 printtab(8)"[161]                          [146][144][161]"
  131. 1310 next
  132. 1320 printtab(8)"[161]                [144][172][162][162][162][162][162][162][162][162][162][146][190]"
  133. 1330 printtab(8)"[161]                [146][144][161]"
  134. 1340 printtab(8)"[161]                [146][144][161]"
  135. 1350 printtab(8)"[161]                [146][144][161]"
  136. 1360 printtab(8)"[161]                [146][144][161]"
  137. 1370 fori=1to6
  138. 1380 printtab(8)"[161]                [146][144][161]"
  139. 1390 next
  140. 1400 printtab(8)"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  141. 1410 by=17:bx=9+int(15*rnd(0)):sysplt,bx,by:print"[209]";
  142. 1420 print""tab(30)"[144] "
  143. 1430 return
  144. 1440 rem *** hole 3 ***
  145. 1450 print"":ts=0
  146. 1460 printtab(20)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  147. 1470 fori=1to5
  148. 1480 printtab(20)"[161]                [146][144][161]"
  149. 1490 next
  150. 1500 printtab(8)"[146][172][162][162][162][162][162][162][162][162][162][162][162][190]                [146][144][161]"
  151. 1510 printtab(8)"[161]                            [146][144][161]"
  152. 1520 printtab(8)"[161]                     [158]       [146][144][161]"
  153. 1530 printtab(8)"[161]                    [158]        [146][144][161]"
  154. 1540 printtab(8)"[161]                    [158]        [146][144][161]"
  155. 1550 printtab(8)"[161]                     [158]       [146][144][161]"
  156. 1560 printtab(8)"[161]                [144][172][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  157. 1570 fori=1to4
  158. 1580 printtab(8)"[161]                [146][144][161]"
  159. 1590 next
  160. 1600 printtab(8)"[146][188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  161. 1610 print""tab(32)"[144] "
  162. 1620 by=17:bx=9+int(15*rnd(0)):sysplt,bx,by:print"[209]"
  163. 1630 return
  164. 1640 rem *** hole 4 ***
  165. 1650 print"":ts=0
  166. 1660 printtab(7)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  167. 1670 fori=1to6
  168. 1680 printtab(7)"[161]                             [146][144][161]"
  169. 1690 next
  170. 1700 printtab(7)"[161]       [144][172][162][162][162][162][162][162][162][162][162][187][146]           [146][144][161]"
  171. 1710 fori=1to4
  172. 1720 printtab(7)"[161]       [144][146][161]         [161]           [146][144][161]"
  173. 1730 next
  174. 1740 printtab(7)"[161]       [144][188][146][162][162][162][187]     [188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  175. 1750 fori=1to3
  176. 1760 printtab(7)"[161]           [144][146][161]"
  177. 1770 next
  178. 1780 printtab(7)"[188][162][162][162][162][162][162][162][162][162][162][162][146][190]"
  179. 1790 print""tab(18)"[158]        [157][157][157][157][157][157]      [157][157][157][157]"
  180. 1800 printtab(25)"[157][157][157]    [157][157][157][157][157]       [157][157]  "
  181. 1810 sysplt,32,11:print"[144] "
  182. 1820 by=16:bx=8+int(10*rnd(0)):sysplt,bx,by:print"[209]"
  183. 1830 return
  184. 1840 rem *** hole 5 ***
  185. 1850 print""
  186. 1860 print"":ts=0
  187. 1870 printtab(10)"[144][172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][